package com.renyr.model;

import com.renyr.utils.StateCode;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class ResponseData<T> {

	private int code = StateCode.ERROR.getCode();
	private T data;
	private String msg;

    public ResponseData () {}

	public ResponseData (T t) {
	    if (null != t) {
            this.code = StateCode.SUCCESS.getCode();
            this.data = t;
            this.msg = "保存成功";
        } else {
            this.msg = "保存失败";
        }
    }
	
}
